package com.example.bakend.mapper;

import com.example.bakend.pojo.Category;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Service;

import java.util.List;

@Mapper
public interface CategoryMapper {
    @Insert("insert into book_categories(category_name,create_time,update_time) values (#{categoryName},#{createTime},#{updateTime})")
    Integer insertCategory(Category category);

    @Delete("delete from book_categories where id = #{id}")
    Integer deleteCategory(Integer id);

    @Select("select * from book_categories")
    List<Category> getList();

    @Select("select * from book_categories")
    List<Category> getAll();
}
